<script setup>
    import { onLaunch, onLoad, onShow, onHide } from '@dcloudio/uni-app';
    import { ref, reactive, inject } from 'vue';
    
    import request from '@/api/request';
    
    const router = inject('$router');
    const storage = inject('$storage');
    
    // 注册路由拦截器
    router.interceptors();
    
    // 注册接口拦截器
    request.interceptors();
    
    // 获取状态栏高度
    const getSystemInfo = () => {
        let statusBarHeight = storage.get('statusBarHeight');
        if (!statusBarHeight) {
            uni.getSystemInfo({
                success: (res) => {
                    storage.set('statusBarHeight', res.statusBarHeight);
                }
            });
        }
    };
    
    onLaunch(() => {
        console.log('App Launch');
    });
    onShow(() => {
        console.log('App Show');
        getSystemInfo();
    });
    onHide(() => {
        console.log('App Hide');
    });
</script>

<style lang="less">
    /*每个页面公共css */
    @import url('static/css/reset.less');
</style>
